﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using Utils;

namespace MyDiskInfo
{
    /// <summary>
    /// 硬盘信息
    /// </summary>
    [ComVisible(true)]
    [Guid("C7B92F87-7E59-467F-A6FF-9518DADA1C2C")]
    [DeskBandInfo("DiskInfo", "Show DiskInfo")]
    public class DiskInfo : DeskBand
    {
        #region 字段
        private int _width = 290;
        private int _height = 30;
        private DiskInfoCtrl _diskInfo;
        #endregion

        #region 构造函数
        public DiskInfo()
        {
            LogUtil.Log("DiskInfo Start");

            this.BackColorTransparent = true;

            //尺寸
            this.MinSize = new Size(_width, _height);
            this.MinSizeVertical = new Size(_width, _height);
            this.Size = new Size(_width, _height);
            this.MaxSize = new Size(_width, _height);

            _diskInfo = new DiskInfoCtrl();
            _diskInfo.Width = _width;
            _diskInfo.Height = _height;
            this.Width = _width;
            this.Height = _height;
            this.Child = _diskInfo;

            LogUtil.Log("DiskInfo End");
        }
        #endregion

        #region 释放资源
        public override void ClearResources()
        {
            if (_diskInfo != null)
            {
                _diskInfo.ClearResources();
            }
        }
        #endregion

    }
}
